package com.example.onlineeducation.mapper

import com.example.onlineeducation.data.json.CertificateListJson
import com.example.onlineeducation.data.model.CertificateListDataModel
import com.yc.jetpacklib.extension.ycToNoEmpty
import com.yc.jetpacklib.mapper.IMapper

class CertificateListMapper : IMapper<CertificateListJson, CertificateListDataModel> {
    override fun map(input: CertificateListJson): CertificateListDataModel = CertificateListDataModel(
        input.certInfo?.certId,
        input.examInfo?.imageUrl,//考试图片
        input.score.ycToNoEmpty("0") + "分",
        input.proName.ycToNoEmpty(),
        input.examName.ycToNoEmpty(),
        input.examCreateTime.ycToNoEmpty(),
        input.certInfo?.sealImageUrl,//证书印章图片路径
        input.content,//证书内容HtmlCode
    )
}

